1 Introduction

This tutorial is an introduction to downloading and mapping data from OpenStreetMap using QGIS. OpenStreetMap, or OSM, is a free, editable map of the world created and edited entirely by volunteer contributors known as mappers. QGIS is a free, open-source geographic information system (GIS) application that allows users to view, edit, visualize, and analyze geographic data. This tutorial is intended to guide a complete beginner to OpenStreetMap and GIS software through the process of downloading OSM data and creating a simple, informative map.

In this tutorial, we will be mapping parks and playgrounds in Baltimore, Maryland.

Requirements: This tutorial requires a Windows or Apple computer, an installation of QGIS (or the ability to install the program on the computer), and an internet connection. No other software or experience is necessary!

2 Download QGIS and plug-ins

2.1 Install QGIS

The first step is to download QGIS, the software that we’ll be using to view data from OpenStreetMap and create maps. Go to this link to download the latest version for Windows or Mac. If you are using a Windows computer, download the “standalone installer” (shown below).

Installing QGIS on Windows computers

Installing QGIS on Windows computers

If you are using an Apple computer, download the newest installer (shown below).

Installing QGIS on Apple computers

Installing QGIS on Apple computers

Then, follow the prompts to install QGIS on your computer like you would with any other program.

2.2 Install plug-ins

2.2.1 QuickMapServices plugin

Open up QGIS. The first thing you might notice is that this is a mapping software, but there’s no map on the screen!

Let’s change that by adding a basemap. A basemap is like a background image for your map. It should include enough features like state borders, highways, waterways, or notable monuments to give readers geographic context, but it should be subtle (and attractive) enough that the most important features of your map (in this case, parks and playgrounds) stand out in a visually pleasing way.

2.2.1.1 Search for the plugin

While we could find those basemap features on our own, an easier option is to use the QuickMapServices plugin, which lets us choose from a number of pre-packaged basemaps. Like your web browser, QGIS features a large collection of plugins, which users can install to extend the software’s functionality. To install the QuickMapServices plugin, first go to Plugins -> Manage and Install Plugins....

Manage and install plugins

Manage and install plugins

2.2.1.2 Install the plugin

Then, search for “quickmapservices” in the search bar, click QuickMapServices, and then click Install Plugin. The plugin should take a few seconds to install.

Search for QuickMapServices and install

Search for QuickMapServices and install

2.2.2 QuickOSM plugin

While we’re here, let’s also install the QuickOSM plugin. This plugin will let us search for and download data from OpenStreetMap. Search for “quickosm” and install that plugin the same way like you installed QuickMapServices.

Search for QuickOSM and install

Search for QuickOSM and install

3 Add a basemap

3.1 Try the OpenStreetMap Standard basemap

QuickMapServices is now installed, and it appears as a little blue globe icon in the toolbar. Click on the icon and then go to OSM to see some of the basemaps built into the plugin. Let’s try adding the OpenStreetMap Standard as a base for our map.

Add the OpenStreetMap Standard basemap

Add the OpenStreetMap Standard basemap

3.1.1 Zooming into Baltimore

We have a map! Try zooming in on Baltimore. You can do so by using the scroll wheel on your mouse or the magnifying glass icon. If you click and drag the mouse with the magnifying glass option to draw a box, the map will zoom in so that that box fills your screen.

Zoom with your scroll wheel or the magnifying glass tool

Zoom with your scroll wheel or the magnifying glass tool

That’s Baltimore! As you can see, this map includes tons of information, including roads, parks, airports, waterways, municipality names, and county boundaries. This is really useful for getting a full geographic picture of the city, but if we’re just trying to highlight the city’s parks and playgrounds, it’s probably more information than we need, and it’ll make it hard to see some of the smaller ones.

3.1.2 Introduction to the Layers panel

In the bottom left corner of your screen in the “Layers” panel, try unchecking the box next to “OSM Standard”. What happens? And what happens if you re-check the box? Now, go back to the QuickMapServices toolbar and try adding a different basemap. What do you see in the Layers panel?

Turning off the basemap layer

Turning off the basemap layer

Maps in QGIS are made up of layers. The “OSM Standard” layer corresponds to the OSM Standard basemap that we added. Unchecking the box turns the layer “off”, meaning we don’t see it anymore. When you added the second basemap, that showed up as another layer. The order of layers is very important. Layers will sit on top of any layers that are underneath. Try clicking and dragging the layers to change their order. Do you see any changes on the map? (Make sure the layers are turned on when you try this).

3.2 Adding more basemaps

QuickMapServices comes with a few very nice basemaps, but the selection is limited. We can add more basemaps by going to QuickMapServices -> Settings -> More Services -> Get contributed pack.

Adding more basemapsAdding more basemaps

Adding more basemaps

You should now see a much larger selection of basemaps!

Newly added basemaps

Newly added basemaps

Try out some of those new basemaps we just added. The screenshots in the rest of this tutorial will use Stamen -> Stamen Toner Background as the basemap, but feel free to use whichever basemap you like!

Stamen Toner Background basemap

Stamen Toner Background basemap

4 Download OSM data

4.1 Open the QuickOSM plugin

Next, we need to download the data we want from OpenStreetMap: Baltimore’s parks and playgrounds. Click the green magnifying class on the toolbar, the icon for the QuickOSM plugin we just installed.

QuickOSM toolbar icon

QuickOSM toolbar icon

4.1.1 Quick Query tab

A screen pops up for QuickOSM, and by default it’s open on the Quick Query tab. For this tutorial, we’ll be sticking with Quick Query and its simple interface. As you continue working with OSM, however, you might find that Quick Query doesn’t provide the flexibility you need to download certain datasets. In those cases, you’ll want to use the “Query” tab, which lets you write custom queries to OpenStreetMap’s Overpass API.

The Quick Query tab

The Quick Query tab

4.1.2 Spatial Extent field

Take a closer look at the Quick Query tab. The first two fields are Key and Value. We don’t know what those are yet, so let’s skip those for now. Hover over the third field. It says “The spatial extent to use for the query”, and the default option is “In”. This is the geographic area for which we want to download data. If we enter in “Baltimore, Maryland”, we see a message at the bottom of the window that says “All OSM objects in Baltimore, Maryland are going to be downloaded.”

The Spatial Extent field

The Spatial Extent field

4.1.2.1 Searching for place names in Nominatim

You can look up the exact names used for places in OSM by searching for the town or city on Nominatim. This can be helpful if you need to download data for a place with an ambiguous name, like the city of Houston in Texas County, Missouri, and you want to make sure you use the correct name in the query.

Searching for places in Nominatim

Searching for places in Nominatim

Experiment with other options in the drop-down menu. What do you think is the difference between “Canvas Extent” and “Layer Extent”?

4.2 Intro to OSM tags

4.2.1 Key and Value fields

Switch the Spatial Extent drop-down back to “In”, and take another look at the message (shown below). We definitely want to download data for Baltimore, so that part is correct, but we don’t want all OSM objects, just the parks and playgrounds. How do we find those? Let’s start with the parks.

All OSM objects in Baltimore, Maryland are going to be downloaded.

There’s a ton of data in OSM, but each data point is made up of two pieces of information:

  1. The Geography: This is the where. For a building, the geography consists of the building’s location on the Earth (its coordinates and/or its street address) as well as its shape.

  2. The Tag: This is the what. What kind of building is it? A tag in OSM consists of two parts: a key and value. The key represents the broader category, and the value provides the more specific detail. For instance, a department store might be tagged with the key “building” and the value “retail”. In OSM, you’ll usually see the tag represented as key=value, so, for a department store, the full tag would be building=retail.

4.2.2 Finding Key-Value pairs on the OSM Wiki

Now we know that we need to find the tag for parks. The best place to find this information (and most information about OSM) is the OpenStreetMap Wiki. Try searching for “park” in the search bar. You’ll automatically be linked to this page shown below.

The OSM Wiki page for parks

The OSM Wiki page for parks

4.2.3 Downloading the data

Based on the Wiki page, we see that parks are recorded in OSM with the tag leisure=park. With that in mind, let’s go back to QuickOSM and enter those values into the search. You can type the values in yourself or use the dropdown menus to find them. After you’ve typed in the tag, click “Run query”. Within a few seconds, you should receive a message that your query was successful!

Use the tag for parks to download the data

Use the tag for parks to download the data

5 Analyze OSM data

5.1 Points, lines, and polygons: three types of park data

Close the QuickOSM window and return to your map. Take a look at the “Layers” panel. What do you see?

The Layers panel now includes layers for Baltimore's parks

The Layers panel now includes layers for Baltimore’s parks

Three layers that begin with “leisure_park” have been added to the map, and each one has a different icon next to it - a dot, a line, and a square. These icons correspond to different parks on the map, and they mean that each park is represented as a point, a line, or a polygon. What does each of those mean?

5.1.1 Points

These are parks whose locations are recorded in OSM, but not their exact areas or footprints. This is likely because the mapper who first added the park to OSM wasn’t able to draw its shape on the map, and no one else has gotten around to doing so.

5.1.1.1 The Attribute Table

Let’s take a closer look at some of these points. Each park we downloaded from OSM is represented visually on the map, but it’s also represented in a table that gives us more information, like the park’s name. We can access this table by right-clicking on the layer and opening the Attribute Table.

Use the tag for parks to download the data

Use the tag for parks to download the data

Click through the table to get a sense of the information available. Notice that many of the fields are empty. While most of the parks have a name recorded in OSM, some of them do not, and mappers will need to add that information in the future. For now, let’s scroll down to “Kirk Avenue Athletic Field” and then select it by clicking on the row number (the number “18” in the picture below).

Select a park in the attribute table

Select a park in the attribute table

5.1.1.2 Zooming into a park

Then, right-click on the row, press Zoom to Feature, and return to the map.

Zoom to Feature zooms in on the selected park

Zoom to Feature zooms in on the selected park

You’ll see that one of the points in the center of your map is now shaded yellow (the selected park). Zoom into it.

Selected parks turn a different color

Selected parks turn a different color

We know that this is the Kirk Avenue Athletic Field, but on the map, it just shows up as a dot. Can we be sure there’s actually a park there? Try adding a satellite image basemap (using QuickMapServices like we did before) and take a look.

Hint: Bing Satellite is a good choice.

A satellite image confirms the field is there

A satellite image confirms the field is there

The satellite image shows the athletic field is there, but it hasn’t been fully mapped yet. If you’d like, you can contribute to OSM by drawing the park’s shape yourself! See (this link) for a beginner’s guide to contributing to OpenStreetMap.

5.1.2 Lines

Lines are typically used in OSM to map features like roadways or paths rather than parks. In this case, we can take a look at the attribute table and see that there are only three entries, two of which are described as fences, and none of which has a name.

Lines are not usually used when mapping parks in OpenStreetMap

Lines are not usually used when mapping parks in OpenStreetMap

5.1.2.1 Deleting Layers

While it’s possible that these entries do correspond to real-world parks, and they were simply drawn incorrectly or mapped with very little information, we’ll treat these parks as data errors in OSM for now and to remove them from the map. You can remove layers in QGIS by right-clicking on the layer and clicking Remove Layer...

Delete unneeded layers from your map

Delete unneeded layers from your map

5.1.3 Polygons

The polygons are parks that are “fully mapped” in OSM, meaning OSM knows both their location and their overall shape. Try zooming in on one of the polygons and turning the layer on and off (using the checkboxes in the Layers panel). Does the shape of the polygons line up with the shape of the park in the satellite image?

A polygon park feature on top of a satellite basemap

A polygon park feature on top of a satellite basemap

The polygon matches the shape of the park underneath

The polygon matches the shape of the park underneath

5.1.4 Exercise: Add playgrounds

For this part of the tutorial, try downloading Baltimore’s playgrounds from OSM and adding them to the map. Are most of the feature you download points, lines, or polygons?

Hint: Check here if you have trouble finding the tag for playgrounds.

After you have successfully added the playgrounds, remove the points layer so that there is only a polygon layer for playgrounds remaining. Your layers panel should look like the below (note that the colors and basemaps listed may look different).

The Layers panel with parks, playgrounds, and basemap layers added

The Layers panel with parks, playgrounds, and basemap layers added

5.2 How big are the parks?

QGIS also allows you to perform geographic analyses with the features on your map. If you ever wanted to know, for example, what percentage of a city’s population lives within half a mile of a park, QGIS is a great tool for the job. In this section, let’s answer a simple question: how big are the parks in Baltimore in acres?

5.2.1 Edit the Attribute Table

First, open the Attribute Table for the parks polygon layer. Then, make the layer editable so we can add a column.

Turn on editing modeTurn on editing mode

Turn on editing mode

Next, open the Field Calculator. The Field Calculator is used for performing calculations on your data. You can perform mathematical operations on your data (like adding or subtracting columns) or geometric operations, like calculating the area of a polygon.

Open the Field Calculator

Open the Field Calculator

In the Field Calculator, name your Output field as “Area” or a name of your choice. Make sure to change the Output field type to “Decimal number (real)”. Then, in the middle panel, expand the Geometry menu and double-click $area. The Expression field will be populated with $area. Click OK. Then, save your edits.

Calculate the parks' areas

Calculate the parks’ areas

Click OK. Then, save your edits.

5.2.2 What are the units?

Back in the Attribute Table, we now have an area column, but since it doesn’t have any units associated with it, it’s hard to understand what it means.

The Area column doesn't include any units

The Area column doesn’t include any units

To find the units, return to your map and go to to Project -> Properties... in the toolbar.

Open the Properties Menu

Open the Properties Menu

Go to the General tab and check the Measurements panel. We see that the units provided are in meters/square meters.

Calculate the parks' areas

Calculate the parks’ areas

5.2.3 Calculate the area in acres

To calculate the areas into acres, return to the Attribute Table and re-open the Field Calculator. Check the Update existing field box and select the “Area” column that we created. Calculate the area again, but this time, divide it by 4047 to convert from square meters to acres.

Calculate the parks' areas in acres

Calculate the parks’ areas in acres

Click OK and save your edits once more.

You’ve just successfully added a column to your data that provides the land area in acres for every park in Baltimore!

The Area column in acres

The Area column in acres

Note: This section skipped discussion of coordinate reference systems and projection systems for geographic data, as they are beyond the scope of this tutorial. For geographic analyses requiring more precise measurements, it’s highly recommended that you project your data using a projection system appropriate for your study area. See this tutorial for more information.

6 Map OSM data

6.1 Layer Aesthetics

The last step in this tutorial is to stylize our map and prepare it for printing and presentation. You can double-click on any layer in the Layers panel to open its properties. Double-click the playgrounds polygon layer and navigate to the Symbology panel.

The Symbology panel for the playgrounds layer

The Symbology panel for the playgrounds layer

Here, you can see a menu of different options for the modifying the layer’s aesthetics, including its fill color, border, and transparency. Pre-set options are available at the bottom. Try modifying the playgrounds’ aesthetics however you’d like (have fun with it!).

6.2 Color the parks by size

That was an example of a simple fill - every playground in the layer has the same aesthetics, regardless of any differences among them. For the parks polygon layer, let’s try coloring each park based on its size. The bigger the park, the darker its shade of green will be.

  1. Open the Symbology menu for the parks polygon layer and switch the drop-down option at the top from “Single symbol” to “Graduated”.
  2. In the Value field, add the “Area” column that we created earlier. Then, click the arrow to the right of the Color ramp drop-down menu and choose one of the options.
  3. Lastly, click Classify in the bottom-left of the menu and then OK.
Color the parks based on their size

Color the parks based on their size

You should see that larger parks are darker and smaller parks are lighter.

6.3 Basemap aesthetics

Note that you can also modify the aesthetics for your basemap layers. This can be helpful if you’re using a satellite image basemap but don’t want your map to look too busy.

Try modifying the transparency of your basemap layer

Try modifying the transparency of your basemap layer

Map features now stand out more clearly

Map features now stand out more clearly

6.4 Lay out and export the map

6.4.1 The Print Layout view

To this point, we’ve been using the QGIS window to navigate and explore our data. Now that we’re turning to the task of laying out our final map, however, we need to use the Print Layout, which lets us preview how our map will look printed on the page. To open the Print Layout, go to Project -> New Print Layout... and enter a name for your map file.

Open the Print Layout

Open the Print Layout

You’ll be greeted with a completely blank page. As a first step, right-click on the canvas (the white part of the screen) and select Page Properties...

The blank Print Layout page

The blank Print Layout page

6.4.2 Layout size and orientation

Change the paper Size to “Letter” and the Orientation to “Portait”. You should see the canvas change as you click these options.

Modify the size and orientation of the layout

Modify the size and orientation of the layout

6.4.3 Add the map to the layout

Now, click the Add Map button and then draw a box on your canvas that corresponds to where you’d like to see the map on your printed page. After you draw the box, you should see your map of Baltimore appear on the page.

Add the map to the layout

Add the map to the layout

6.4.4 Adjust the map’s extent and zoom

The map will be zoomed into roughly where it was zoomed in on the main QGIS window. Still, it may not be zoomed or centered to your liking. To adjust the map, click the Move item content button. Click and drag on the map to adjust its extent, and use your scroll wheel to zoom in and out.

Use the Move item content tool to adjust the map

Use the Move item content tool to adjust the map

If you’re having trouble getting the zoom just right, adjust the Scale in the Item Properties panel on the right side of your screen.

The Scale property lets you fine-tune the zoom level

The Scale property lets you fine-tune the zoom level

If you don’t like how your updated map aesthetics look on the page, you can go back to the main QGIS window, adjust the aesthetics as you’d like, and then hit the Refresh view button on the Print Layout view. This will update your map’s appearance to match its appearance in the main window.

The Refresh view button

The Refresh view button

6.4.5 Add a title

Once you’ve got your map layout looking just how you’d like it, we can add other components to the map like a title, legend, and scale bar. To add a title, click the Add label button and draw a box where you’d like the title to go.

Use the Add label tool to add a title or other text

Use the Add label tool to add a title or other text

You can use the Item Properties panel to change the text and its aesthetics.

Adjust the title text and aesthetics in the Item Properties panel

Adjust the title text and aesthetics in the Item Properties panel

6.4.6 Add a legend

Next, click the Add Legend button and draw a box for your legend.

Use the Add Legend tool to add a legend

Use the Add Legend tool to add a legend

By default, it will include all of the layers from your main QGIS window using their default names. These won’t be very intuitive for your readers, so let’s edit them!

By default, the legend uses the names of the layers

By default, the legend uses the names of the layers

To do so, uncheck the Auto update box in the Item Properties panel. This will “unlink” the legend from your main QGIS window, allowing you to update the legend as you’d like. To remove layers (like basemaps), highlight the layer and click the red minus sign. To rename layers, double-click on the layer and modify the text.

Remove and rename legend items in the Item Properties panel

Remove and rename legend items in the Item Properties panel

6.4.7 Add a scale bar

Finally, let’s add a scale bar. Click the Add Scale Bar button and draw a box to place the scale bar

Use the Add Scale Bar tool to add a scale bar

Use the Add Scale Bar tool to add a scale bar

You can experiment with the options in the Item Properties panel to modify the units, size, style, and intervals of the scale bar.

Adjust scale bar aesthetics and labels in the Item Properties panel

Adjust scale bar aesthetics and labels in the Item Properties panel

6.4.8 Finalize and export the map!

Take some more time to explore the other buttons and features in the Print Layout view. Make any additional aesthetic tweaks that you would like until you’re happy with your map. Once you’re ready, the last step is for us to export the map. There are several options for export format, but the easiest is probably PDF. Click the Export as PDF button and then save the map with an informative title. When the PDF Export Options menu pops up, click Save.

Export the map as PDF

Export the map as PDF

You should now be able to share the map and view it on any computer like a standard PDF. Congratulations! You just made your first map in QGIS with OpenStreetMap data.

Your final map!

Your final map!